#include <51func.h>
int main(int argc, char *argv[])
{
    // ./0_is_the_same file1 file2
    ARGS_CHECK(argc,3);
    int fd1 = open(argv[1],O_RDONLY);
    ERROR_CHECK(fd1,-1,"fd1 open");
    int fd2 = open(argv[2],O_RDONLY);
    ERROR_CHECK(fd2,-1,"fd2 open");
    char buf1[4096];
    char buf2[4096];
    while(1){
        memset(buf1,0,4096);
        ssize_t sret1 = read(fd1,buf1,4096);
        memset(buf2,0,4096);
        ssize_t sret2 = read(fd2,buf2,4096);
        if(sret1 != sret2){
            printf("Not the same!\n");
            break;
        }
        else if(memcmp(buf1,buf2,sret1) != 0){
            printf("Not the same!\n");
            break;
        }

        if(sret1 == 0){
            printf("The same!\n");
            break;
        }
    }
    return 0;
}

